package kr.pe.osdev.common.util;

public class StringConvertor {
    private static final String IS_TRUE = "1";
    private static final String IS_FALSE = "0";
    
    public static String convertorBooleanToString(boolean bool) {
        if(bool) {
            return IS_TRUE;
        }
        
        return IS_FALSE;
    }
    
    public static boolean convertorStringToBoolean(String bool) {
        if(bool != null && "1".equals(bool)) {
            return true;
        }
        
        return false; 
    }
    
    public static String convertNulltoString(String str, String replace) {
        if (isEmpty(str))
            return replace;
        return str;
    }
    
    public static boolean isEmpty(String str) {
        return str == null || str.length() == 0;
    }
}
